<?php

namespace app\index\controller;

use app\index\model\QjQuestionModel;



class Question
{
    public $msgId;

    public function __construct()
    {
        $this->msgId = getHeader('MsgId', 0);
    }

    public function getQuestionList()
    {
        $question_id = input('question_id', 0);
        if (empty($this->msgId)) {
            $res['success'] = false;
            $res['desc'] = 'msgId 参数错误';
            $res['errorcode'] = '200022';
            return json($res);
        }
        $model = new QjQuestionModel();

        $res = $model->getQuestionInfoNoPage($question_id, $this->msgId);
        return json($res);
    }
    public function getQuestionListByContent()
    {
        $content = input('content', '');
        $en_content = input('en_content', '');
        if (empty($this->msgId)) {
            $res['success'] = false;
            $res['desc'] = 'msgId 参数错误';
            $res['errorcode'] = '200022';
            return json($res);
        }
        if (empty($content)) {
            $res['success'] = false;
            $res['desc'] = '参数错误';
            $res['errorcode'] = '200022';
            return json($res);
        }
        $model = new QjQuestionModel();
        $res = $model->getQuestionListByContent($content, $en_content, $this->msgId);
        return json($res);
    }
}
